1
我使用的soapUI測試一些Web服務。故障設置WS響應架構
在MockService在soapUI的可我得到這個默認響應
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.someurl.com/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:Response>
<sch:Something>?</sch:Something>
</sch:Response>
</soapenv:Body>
</soapenv:Envelope>
當真正的web服務被稱爲我不明白的xmlns:SCH =「http://www.someurl.com/schemas」和響應內的元素不帶'sch'前綴。這裏是我得到:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<Response>
<Something>something</Something>
</Response>
</soapenv:Body>
</soapenv:Envelope>
我用spring-ws使用Java。並使用Castor將marshall xml編譯爲Java對象。
如何在響應的模式?
編輯:添加配置的詳細信息。
所有MyApplication-servlet.xml中是這樣
<bean id="payloadMapping"
class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
<property name="endpointMap">
<map>
<entry
key="{http://www.someurl.com/schemas}MyRequest"
value-ref="myEndpoint"/>
</map>
</property>
</bean>
<bean id="myEndpoint"
class="foo.bar.myEndpoint">
<constructor-arg ref="messageSource" />
<property name="marshaller" ref="marshaller" />
<property name="unmarshaller" ref="marshaller" />
</bean>
<bean id="myWsdlDefinition"
class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schema">
<bean class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/MyXsd.xsd" />
</bean>
</property>
<property name="portTypeName" value="myPortTypeName" />
<property name="locationUri" value="http://anotherUrl:8080/services" />
</bean>
<bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
<property name="mappingLocation" value="classpath:mapping.xml" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="errors" />
</bean>
我們不能告訴你爲什麼春天-WS已誤配置的,如果你給我們編輯 – skaffman 2010-01-28 13:31:46
@skaffman問題上沒有信息,請? – 2010-01-28 13:47:29