Which custom jaxb binding should I use? - java

I generate Java code using wsimport and a given, 3rd party WSDL (which I can't change).
The WSDL uses a Java keyword ('return') and thus wsimport will not generate the JAVA code.
To be able to show you an example I globally replaced the name 'return' into 'retParam'.
Here's the generated java code fot a certain message from the WSDL:
/**
*
* #param retParam
* #param header0
* #param parameters
* #param header
*/
#WebMethod(operationName = "CreatePermissionRequest", action = "http://www.url.be/WSUpdate/v1/CreatePermissionRequest")
public void createPermissionRequest(
#WebParam(name = "CreatePermissionRequestRequest", targetNamespace = "http://www.url2.be/WSUpdate/messages/v1_00", partName = "parameters")
CreatePermissionRequestRequest parameters,
#WebParam(name = "SyncHeader", targetNamespace = "http://www.url.be/v1_00", header = true, partName = "header")
SyncHeader header,
#WebParam(name = "CreatePermissionRequestReply", targetNamespace = "http://www.url2.be/WSUpdate/messages/v1_00", mode = WebParam.Mode.OUT, partName = "retParam")
Holder<CreatePermissionRequestReply> retParam,
#WebParam(name = "SyncResponseHeader", targetNamespace = "http://www.url.be/v1_00", header = true, mode = WebParam.Mode.OUT, partName = "header")
Holder<SyncResponseHeader> header0);
And this is the entry in the WSDL :
<message name="CreatePermissionRequestReply">
<part name="retParam" element="messages:CreatePermissionRequestReply" />
<part name="header" element="fsb:SyncResponseHeader" />
</message>
As you can see the part name is called 'retParam' and this is translated in an attribute of the createPermissionRequest - interface. Which custom binding do I need the specify when I generate the Java code using wsimport so the the part name 'retParam' is mapped to something else ?
Currently I'm using this bindings file, but it doesn't work :( :
<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" version="2.0" wsdlLocation="WSUpdateTAP.wsdl">
<jaxws:bindings node="wsdl:definitions/wsdl:portType[#name='WSUpdate']/wsdl:operation[#name='CreatePermissionRequest']">
<jaxb:parameter part="definitions/message[#name='CreatePermissionRequestReply']/
part[#name='retParam']" element="retParam"
name="ret"/>
</jaxws:bindings>
</jaxws:bindings>
And here is a full WSDL (not fot the Update service as mentioned above, but for the Status service, it's a smaller WSDL but has the same problem : use of return keyword) :
<types>
<xs:schema
targetNamespace="http://www.url2.be/WSStatus/messages/v1_00"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.url1.be/v1_00"
schemaLocation="fsb/fsb.xsd" />
<xs:include schemaLocation="WSStatus/wsstatus_messages.xsd" />
</xs:schema>
</types>
<message name="checkAvailabilityRequestMessage">
<part name="parameters" element="messages:checkAvailability" />
<part name="header" element="fsb:SyncHeader" />
</message>
<message name="checkAvailabilityResponseMessage">
<part name="return" element="messages:checkAvailabilityReturn" />
<part name="header" element="fsb:SyncResponseHeader" />
</message>
<portType name="WSStatus">
<operation name="checkAvailability">
<input message="tns:checkAvailabilityRequestMessage"></input>
<output message="tns:checkAvailabilityResponseMessage"></output>
</operation>
</portType>
<binding name="WSStatusSOAPBinding" type="tns:WSStatus">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="checkAvailability">
<soap:operation style="document"
soapAction="http://www.url1.be/WSStatus/v1/checkAvailability" />
<input>
<soap:body use="literal" parts="parameters" />
<soap:header use="literal" part="header"
message="tns:checkAvailabilityRequestMessage" />
</input>
<output>
<soap:body use="literal" parts="return" />
<soap:header use="literal" part="header"
message="tns:checkAvailabilityResponseMessage">
</soap:header>
</output>
</operation>
</binding>
<service name="WSStatusService">
<port name="WSStatusSOAP" binding="tns:WSStatusSOAPBinding">
<soap:address location="https://www.url2.be/fsb/WSStatus" />
</port>
</service>
</definitions>
Any ideas what's wrong ?

Related

php webservice and jax-ws client ServerSOAPFaultException

My nusopa php service located on link:
http://localhost/SOAP/soapWebService.php?wsdl
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://localhost/soap/samplePHPService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/soap/samplePHPService">
<types>
<xsd:schema targetNamespace="http://localhost/soap/samplePHPService">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:schema>
</types>
<message name="wonderLocatedPlaceRequest">
<part name="name" type="xsd:string"/>
</message>
<message name="wonderLocatedPlaceResponse">
<part name="return" type="xsd:string"/>
</message>
<portType name="samplePHPServicePortType">
<operation name="wonderLocatedPlace">
<input message="tns:wonderLocatedPlaceRequest"/>
<output message="tns:wonderLocatedPlaceResponse"/>
</operation>
</portType>
<binding name="samplePHPServiceBinding" type="tns:samplePHPServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="wonderLocatedPlace">
<soap:operation soapAction="http://localhost/SOAP/soapWebService.php/wonderLocatedPlace" style="rpc"/>
<input>
<soap:body use="literal" namespace=""/>
</input>
<output>
<soap:body use="literal" namespace=""/>
</output>
</operation>
</binding>
<service name="samplePHPService">
<port name="samplePHPServicePort" binding="tns:samplePHPServiceBinding">
<soap:address location="http://localhost/SOAP/soapWebService.php"/>
</port>
</service>
</definitions>
I make java classes by wsimport.exe and have tou class.
Next i create employe client:
public class Main {
public static void main(String[] args) throws MalformedURLException {
SamplePHPServicePortType stub;
//Generating stub to use the existing service
stub = new SamplePHPService().getSamplePHPServicePort();
//Calling the existing service with the stub
String place = stub.wonderLocatedPlace("Taj Mahal");
System.out.println(place);
}
}
And get exception:
Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: error in msg parsing:
xml was empty, didn't parse! Please see the server log to find more detail regarding exact cause of the failure.
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:116)
at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(StubHandler.java:238)
at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:189)
at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:276)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:104)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)
at com.sun.proxy.$Proxy29.wonderLocatedPlace(Unknown Source)
at com.company.Main.main(Main.java:22)
Validity xml be sucsesseful, but have other problem.. What is it?

Error in Callin Java webservice from Android using k-Soap

I have a created a simple Login Webservice in Java and I am calling it from the Android code. I am passing two String Parameters to the Webservice. But they become null in the Webservice.
WebService Code :
public boolean authenicateUser(#WebParam(name="username")String username,
#WebParam(name="password")String password) {
System.out.println("Inside Authenticae USER+=========="+name+"-----"+Password);//This becomes null and null
final String LOGIN_SQL="SELECT * FROM UserDetails WHERE UserName=? and Password=?";
The Web service is hosted on Localhost Tomcat server
Android Server Request :
private static String NAMESPACE = "http://src.AndroidExample.Nagesh.com/";
private static String URL = "http://192.168.56.1:8080/AndroidLoginWS/LoginWebService?wsdl";
private static String SOAP_ACTION = "http://src.AndroidExample.Nagesh.com/";
Systerequest=new SoapObject(NAMESPACE,WebMethodName);
System.out.println("Values before calling WS"+user.UserName+"------"+user.Password);
request.addProperty("username", user.UserName);
request.addProperty("password",user.Password);
return request;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION + WebMethodName, envelope);
System.out.println("INside InvokeLoginWS==========RETURNED.................");
SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
loginStatus = Boolean.parseBoolean(response.toString());
The WSDL file is :
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!--
Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b.
-->
<!--
Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b.
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://src.AndroidExample.Nagesh.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://src.AndroidExample.Nagesh.com/" name="LoginService">
<types>
<xsd:schema>
<xsd:import namespace="http://src.AndroidExample.Nagesh.com/" schemaLocation="http://192.168.56.1:8080/AndroidLoginWS/LoginWebService?xsd=1"/>
</xsd:schema>
</types>
<message name="register">
<part name="parameters" element="tns:register"/>
</message>
<message name="registerResponse">
<part name="parameters" element="tns:registerResponse"/>
</message>
<message name="authenicateUser">
<part name="parameters" element="tns:authenicateUser"/>
</message>
<message name="authenicateUserResponse">
<part name="parameters" element="tns:authenicateUserResponse"/>
</message>
<portType name="LoginMethods">
<operation name="register">
<input wsam:Action="http://src.AndroidExample.Nagesh.com/LoginMethods/registerRequest" message="tns:register"/>
<output wsam:Action="http://src.AndroidExample.Nagesh.com/LoginMethods/registerResponse" message="tns:registerResponse"/>
</operation>
<operation name="authenicateUser">
<input wsam:Action="http://src.AndroidExample.Nagesh.com/LoginMethods/authenicateUserRequest" message="tns:authenicateUser"/>
<output wsam:Action="http://src.AndroidExample.Nagesh.com/LoginMethods/authenicateUserResponse" message="tns:authenicateUserResponse"/>
</operation>
</portType>
<binding name="LoginWSPortBinding" type="tns:LoginMethods">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="register">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="authenicateUser">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="LoginService">
<port name="LoginWSPort" binding="tns:LoginWSPortBinding">
<soap:address location="http://192.168.56.1:8080/AndroidLoginWS/LoginWebService"/>
</port>
</service>
</definitions>
I am new to both Android and Creating Web Service. I tried many other solution. But it does not seems to work.
I found the anser for the question. I opened the xsd schema from the wdsl. It was having the parameters as arg0 and arg1 only,though I have given the #WebParam annotation. I changed it in the request, the parameter is getting passed correctly.
final String LOGIN_SQL="SELECT * FROM UserDetails WHERE UserName=? and Password=?";
request.addProperty("name", user.UserName);
request.addProperty("Password",user.Password);
// try to change name to UserName

How to get complex soap response using java web-service?

i have create a web service to add two numbers using netbeans...and i am getting the following response
SOAP Response
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:AddResponse xmlns:ns2="http://calculator.me.org/">
<return>9</return>
</ns2:AddResponse>
</S:Body>
</S:Envelope>
Bu i need to generate the soap response xml of the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<CalculatedValue>9</CalculatedValue>
<response>
my java code:
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.ejb.Stateless;
/**
*
* #author User
*/
#WebService(serviceName = "CalculatorWS")
#Stateless()
public class CalculatorWS {
/**
* This is a sample web service operation
*/
#WebMethod(operationName = "hello")
public String hello(#WebParam(name = "name") String txt) {
return "<a>" + txt + "</a>";
}
/**
* Web service operation
*/
#WebMethod(operationName = "Add")
public int Add(#WebParam(name = "i") int i, #WebParam(name = "j") int j) {
//TODO write your implementation code here:
int k=i+j;
return k;
}
}
wsdl:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1.1-b09 (branches/2.1-6834; 2011-07-16T17:14:48+0000) JAXWS-RI/2.2.5-promoted-b04 JAXWS/2.2. -->
<definitions targetNamespace="http://calculator.me.org/" name="CalculatorWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://calculator.me.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<types>
<xsd:schema>
<xsd:import namespace="http://calculator.me.org/" schemaLocation="CalculatorWS_schema1.xsd"/>
</xsd:schema>
</types>
<message name="hello">
<part name="parameters" element="tns:hello"/>
</message>
<message name="helloResponse">
<part name="parameters" element="tns:helloResponse"/>
</message>
<message name="Add">
<part name="parameters" element="tns:Add"/>
</message>
<message name="AddResponse">
<part name="parameters" element="tns:AddResponse"/>
</message>
<portType name="CalculatorWS">
<operation name="hello">
<input wsam:Action="http://calculator.me.org/CalculatorWS/helloRequest" message="tns:hello"/>
<output wsam:Action="http://calculator.me.org/CalculatorWS/helloResponse" message="tns:helloResponse"/>
</operation>
<operation name="Add">
<input wsam:Action="http://calculator.me.org/CalculatorWS/AddRequest" message="tns:Add"/>
<output wsam:Action="http://calculator.me.org/CalculatorWS/AddResponse" message="tns:AddResponse"/>
</operation>
</portType>
<binding name="CalculatorWSPortBinding" type="tns:CalculatorWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="hello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="Add">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="CalculatorWS">
<port name="CalculatorWSPort" binding="tns:CalculatorWSPortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
i searched a lot on this....but didn't get any answer.I found a similar post in stackoverflow with no correct answer.How to generate that particular soap response using the web-service?
It's not possible to get a reply like the one you posted. By definition a SOAP document (or message) must contain an Envelope and at least the Body element. See more in the SOAP specification.
Your only control is over the contents of the Body element, by specifying the operation style to be RPC (remote procedure call) or document (plain XML).

Perl client to JAX-WS java server issue

I have a JAX-WS java server which publishes a web-service
#WebService(endpointInterface="calculator.operation.Calculator")
public class CalculatorWs implements Calculator{
public String[] add(String a) {
System.out.println(a);
String[] test = {"this", "that"};
System.out.println(test);
return test;
}
}
and
#WebService
#SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
public interface Calculator {
String[] add(String a);
}
and have a perl client
use SOAP::Lite +trace => 'all';
$SOAP::Constants::PREFIX_ENV = 'soapenv';
$SOAP::Constants::PREFIX_ENC = "SOAP-ENC";
my $soap = SOAP::Lite
->service('http://localhost:8080/tomcat/calculator?wsdl')
->soapversion('1.1');
my $var = {'a' => "test"};
my $result = $soap -> add($var);
The problem I'm having is that the Java server does not receive the arguments passed by the Perl client, although the value returned by the Java server is received and recognized by the client.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsam="http://www.w3.org/2
007/05/addressing/metadata" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/
policy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="ht
tp://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://operation.calculator/
" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soapenv:Body><tns:add><c-gensym3
><a xsi:type="xsd:string">test</a></c-gensym3></tns:add></soapenv:Body></soapenv
:Envelope>
this is the SOAP request sent by the Perl client. Im assuming the way its building the SOAP request is to blame . But if anyone could help me figure it out, would be greatly appreciated. Thanks.
(edit)
Here is the WSDL generated by JAX-WS:
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.3-b01-.
-->
- <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.3-b01-.
-->
- <definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://operation.calculator/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://operation.calculator/" name="CalculatorWsService">
- <types>
- <xsd:schema>
<xsd:import namespace="http://operation.calculator/" schemaLocation="http://localhost:8080/tomcat/calculator?xsd=1" />
</xsd:schema>
</types>
- <message name="add">
<part name="parameters" element="tns:add" />
</message>
- <message name="addResponse">
<part name="parameters" element="tns:addResponse" />
</message>
- <portType name="Calculator">
- <operation name="add">
<input wsam:Action="http://operation.calculator/Calculator/addRequest" message="tns:add" />
<output wsam:Action="http://operation.calculator/Calculator/addResponse" message="tns:addResponse" />
</operation>
</portType>
- <binding name="CalculatorWsPortBinding" type="tns:Calculator">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="add">
<soap:operation soapAction="" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="CalculatorWsService">
- <port name="CalculatorWsPort" binding="tns:CalculatorWsPortBinding">
<soap:address location="http://localhost:8080/tomcat/calculator" />
</port>
</service>
</definitions>
Showing the java function is great for java programmers, you need to show the WSDL or sample SOAP (read XML) invocation ... my guess, all you need
my $result = $soap -> add( 'test');
You should know SOAP::Simple is better at wsdl than SOAP::Lite
I was having the same problem. I made it work with the following two changes:
Name your arguments as in the XSD (http://localhost:8080/tomcat/calculator?xsd=1)
Don't use the default namespace, but a namespace prefix for the SOAP method (ns() method).
Example code:
my $soap = SOAP::Lite
-> proxy('http://localhost:8080/tomcat/calculator')
-> ns ('http://operation.calculator/');
my $response = $soap->call('add', SOAP::Data->name( arg0 => 'Peter Pan'));

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: A required header representing a Message Addressing Property is not present

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: A required header representing a Message Addressing Property is not present
what i am missing? i add wdsl-addressing programatically:
wsbp.setOutboundHeaders( new StringHeader(WS_ADDR_VER.messageIDTag, uuid), replyTo.createHeader(WS_ADDR_VER.replyToTag));
i am using jdeveloper 11g
CODE:
asyncNarociloServisService = new AsyncNarociloServisService();
AsyncNarociloServis asyncNarociloServis = asyncNarociloServisService.getAsyncNarociloServisPort();
// Get the request context to set the outgoing addressing properties
WSBindingProvider wsbp = (WSBindingProvider)asyncNarociloServis;
WSEndpointReference replyTo = new WSEndpointReference("http://84.255.215.133:7101/TestniWS-TestniWS-context-root/AsyncNarociloServisResponseImplPort", WS_ADDR_VER);
String uuid = "uuid:" + UUID.randomUUID();
wsbp.setOutboundHeaders( new StringHeader(WS_ADDR_VER.messageIDTag, uuid), replyTo.createHeader(WS_ADDR_VER.replyToTag));
WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions
name="AsyncNarociloServisService"
targetNamespace="http://www.xxx.si/narocilowsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:tns="http://www.xxx.si/narocilowsdl"
xmlns:nar="http://www.xxx.si/narocilo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:pov="http://www.xxx.si/povratnica"
>
<plnk:partnerLinkType name="AsyncNarociloServis">
<plnk:role name="AsyncNarociloServisProvider">
<plnk:portType name="tns:AsyncNarociloServis"/>
</plnk:role>
<plnk:role name="AsyncNarociloServisRequestor">
<plnk:portType name="tns:AsyncNarociloServisResponse"/>
</plnk:role>
</plnk:partnerLinkType>
<types>
<xsd:schema>
<xsd:import namespace="http://www.xxx.si/narocilo" schemaLocation="narocilo.xsd"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://www.xxx.si/povratnica" schemaLocation="povratnica.xsd"/>
</xsd:schema>
</types>
<message name="obdelajNarociloResponse">
<part name="parameters" element="pov:povratnica"/>
</message>
<message name="obdelajNarocilo">
<part name="parameters" element="nar:narocilo"/>
</message>
<portType name="AsyncNarociloServisResponse">
<operation name="obdelajNarociloOperationResponse">
<input message="tns:obdelajNarociloResponse"/>
</operation>
</portType>
<portType name="AsyncNarociloServis">
<operation name="obdelajNarociloOperation">
<input message="tns:obdelajNarocilo"/>
</operation>
</portType>
<binding name="AsyncNarociloServisResponsePortBinding" type="tns:AsyncNarociloServisResponse">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="obdelajNarociloOperationResponse">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<binding name="AsyncNarociloServisPortBinding" type="tns:AsyncNarociloServis">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="obdelajNarociloOperation">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<service name="AsyncNarociloServisService">
<port name="AsyncNarociloServisPort" binding="tns:AsyncNarociloServisPortBinding">
<soap:address location="http://www.xxx.si:9088/ServicesG/services/AsyncNarociloServisPort"/>
</port>
</service>
</definitions>
EDIT:
request
<S:Header>
<To xmlns="http://www.w3.org/2005/08/addressing">??</To>
<Action xmlns="http://www.w3.org/2005/08/addressing">??</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:c839d6f4-2c33-4f5b-b001-7ce9869a3aa3</MessageID>
<wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://84.255.215.133:7101/TestniWS-TestniWS-context-root/AsyncNarociloServisResponseImplPort</wsa:Address>
</wsa:ReplyTo>
</S:Header>
<S:Body>
what to be in ??
I think you should add a WS-Adressing header.
I think that's what the message says.
I don't know what's the framework you use for your Web Service call but here is an example using the CXF as framework: http://cxf.apache.org/docs/ws-addressing.html.
Maybe take a look at this article: http://log.illsley.org/2006/10/05/a-required-header-representing-a-message-addressing-property-is-not-present/.
You can try something like:
<Action xmlns="http://www.w3.org/2005/08/addressing">http://www.kemofarmacija.si/narocilowsdl:obdelajNarociloOperation</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:8ff3f2f0-6548-4411-8075-98af3cc23a1b</MessageID>
<To xmlns="http://www.w3.org/2005/08/addressing">http://elona2.kemofarmacija.si:9088/ServicesG/services/AsyncNarociloServisPort</To>
<ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>

Categories

Resources