Java – missing soapaction header when using CXF
•
Java
I have a WSDL file from an external WS and I am connecting to it I'm trying to use CXF (with Jax - WS) But I got errors from other systems So I decided to take a look at the data we sent to the system. The only difference is that CXF sets an empty soapaction HTTP header
I did some reading and it seems that only known solutions point directly to WSDL But I have already done so
Anyone has a clue?
<bean id="object" class="xxx.XxxObject" factory-bean="objectFActory" factory-method="create"/> <bean id="objectFActory" class="org.apache.cxf.jaxws.JaxWsProxyfactorybean"> <property name="serviceClass" value="xxx.XxxObject"/> <property name="wsdlLocation" value="http://blebleble"/> <property name="address" value="http://blebleble"/> <property name="username" value="user"/> <property name="password" value="password"/> <property name="properties"> <map> <entry key="javax.xml.ws.session.maintain" value-type="java.lang.Boolean" value="true"/> </map> </property> </bean>
Head:
POST /somepath HTTP/1.1 Content-Type: text/xml; charset=UTF-8 Accept: */* Authorization: Basic <randomhex> SOAPAction: "" User-Agent: Apache CXF 2.7.6 Cache-Control: no-cache Pragma: no-cache Host: somehost:8080 Connection: keep-alive Content-Length: 2791
Solution
These are not unique to CXF It is all standard Jax - WS
You can use the action property of the @ webmethod annotation to set soap operations for example
@WebMethod(operationName = "TestOperation",action="http://example.org/TestOperation")
If you use wsimport to generate artifacts from WSDL, you should have set this setting in the annotated interface of @ WebService
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码