The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » Metro and JAXB

Thread: Handling empty HTTP POST in JAX-WS

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 11 - Last Post: Jun 23, 2009 11:35 AM by: Rama Pulavarthi
prakash_29

Posts: 3
Handling empty HTTP POST in JAX-WS
Posted: Jun 17, 2009 10:42 PM
 
  Click to reply to this thread Reply

Hi All,

I want to respond to an Empty HTTP POST (with out any body) from my JAX-WS web service.
I tried adding handlers (both Logical and SOAP handlers). But the server throws exception and the handlers were NOT called.

10:49:04,790 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
org.jboss.ws.core.CommonSOAPFaultException: Endpoint {http://acs.mobax.com/}ACSPort does not contain operation meta data for empty soap body

I want to handle the request at the HTTP level itself.
Any suggestion would be really helpful to me.

Thanks and Best Regards,
Prakash

ramapulavarthi

Posts: 525
Re: Handling empty HTTP POST in JAX-WS
Posted: Jun 18, 2009 9:58 PM   in response to: prakash_29
 
  Click to reply to this thread Reply

You can override handleFault() in your handler so that it gets called when the endpoint throws an exception.

prakash_29

Posts: 3
Re: Handling empty HTTP POST in JAX-WS
Posted: Jun 18, 2009 10:41 PM   in response to: ramapulavarthi
 
  Click to reply to this thread Reply

Thanks for your reply.
I had already overridden the handleFault method. But it was not called.

Carl Roberts
Question about SOAP 1.2 support
Posted: Jun 19, 2009 6:31 AM   in response to: prakash_29
  Click to reply to this thread Reply

Hi,

I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.

Questions:

1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?

2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

But when I change my wsdl to use that namespace I get this error from wsimport:

[wsimport]
[wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
[wsimport] You must specify the "-extension" option to use this binding.
[wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
[wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl

I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"


But now I get this error from wsimport:


[wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
[wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
[wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] generating code...

How do I solve this error or create a service that does use SOAP 1.2?


Here is my WSDL content:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:sch="http://oracle.com/webservices/documentservice"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
xmlns:tns="http://oracle.com/webservices/documentservice"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
targetNamespace="http://oracle.com/webservices/documentservice">


<wsdl:types>
<xsd:schema>
<xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
</xsd:schema>
</wsdl:types>

<wsdl:message name="DoCallIDSRequest">
<wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
</wsdl:message>

<wsdl:message name="DoCallIDSResponse">
<wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
</wsdl:message>

<wsdl:message name="DoCallIDSFault">
<wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
</wsdl:message>

<wsdl:message name="DoCallIDSOneWayRequest">
<wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
</wsdl:message>


<wsdl:portType name="DocumentServicePortType">

<wsdl:operation name="DoCallIDS">
<wsdl:input message="tns:DoCallIDSRequest"/>
<wsdl:output message="tns:DoCallIDSResponse"/>
<wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
</wsdl:operation>

<wsdl:operation name="DoCallIDSOneWay">
<wsdl:input message="tns:DoCallIDSOneWayRequest"/>
</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
<wsaw:UsingAddressing wsdl:required="false"/>
<soap12:binding
style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="DoCallIDS">
<soap12:operation
soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DoCallIDSFault">
<soap12:fault name="DoCallIDSFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>

<wsdl:operation name="DoCallIDSOneWay">
<soap12:operation
soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
soapActionRequired="false"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
</wsdl:operation>

</wsdl:binding>


<wsdl:service name="DocumentService">
<wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
<soap12:address location="http://localhost:8080/oracle-document-service/service"/>
</wsdl:port>
</wsdl:service>

</wsdl:definitions>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Carl Roberts
RE: Question about SOAP 1.2 support
Posted: Jun 19, 2009 6:44 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Also, your samples seem a little different:


For the mtom-soap12 sample:

the wsdl show this:

<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

The sun-jaxws file shows this:

binding="http://www.w3.org/2003/05/soap/bindings/HTTP/"





For the fromwsdl-soap12 sample:

the wsdl shows this:

<soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />

The sun-jaxws file shows this:

binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"




Which one is right?



Thanks,


Joe

-----Original Message-----
From: Carl Roberts [mailto:carl.roberts@oracle.com]
Sent: Friday, June 19, 2009 9:31 AM
To: 'users@metro.dev.java.net'
Subject: Question about SOAP 1.2 support

Hi,

I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.

Questions:

1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?

2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

But when I change my wsdl to use that namespace I get this error from wsimport:

[wsimport]
[wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
[wsimport] You must specify the "-extension" option to use this binding.
[wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
[wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl

I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"


But now I get this error from wsimport:


[wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
[wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
[wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] generating code...

How do I solve this error or create a service that does use SOAP 1.2?


Here is my WSDL content:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:sch="http://oracle.com/webservices/documentservice"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
xmlns:tns="http://oracle.com/webservices/documentservice"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
targetNamespace="http://oracle.com/webservices/documentservice">


<wsdl:types>
<xsd:schema>
<xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
</xsd:schema>
</wsdl:types>

<wsdl:message name="DoCallIDSRequest">
<wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
</wsdl:message>

<wsdl:message name="DoCallIDSResponse">
<wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
</wsdl:message>

<wsdl:message name="DoCallIDSFault">
<wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
</wsdl:message>

<wsdl:message name="DoCallIDSOneWayRequest">
<wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
</wsdl:message>


<wsdl:portType name="DocumentServicePortType">

<wsdl:operation name="DoCallIDS">
<wsdl:input message="tns:DoCallIDSRequest"/>
<wsdl:output message="tns:DoCallIDSResponse"/>
<wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
</wsdl:operation>

<wsdl:operation name="DoCallIDSOneWay">
<wsdl:input message="tns:DoCallIDSOneWayRequest"/>
</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
<wsaw:UsingAddressing wsdl:required="false"/>
<soap12:binding
style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="DoCallIDS">
<soap12:operation
soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DoCallIDSFault">
<soap12:fault name="DoCallIDSFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>

<wsdl:operation name="DoCallIDSOneWay">
<soap12:operation
soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
soapActionRequired="false"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
</wsdl:operation>

</wsdl:binding>


<wsdl:service name="DocumentService">
<wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
<soap12:address location="http://localhost:8080/oracle-document-service/service"/>
</wsdl:port>
</wsdl:service>

</wsdl:definitions>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Rama Pulavarthi
Re: Question about SOAP 1.2 support
Posted: Jun 19, 2009 8:54 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Hi,
Both can be used, there is one minor difference though.

For specifying SOAP 1.2 in WSDL, though <soap12:binding
style="document" transport="http://schemas.xmlsoap.org/soap/http"/> is
often used, it not standard yet.
When you use binding="http://www.w3.org/2003/05/soap/bindings/HTTP/"
or
binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/",
it tells JAX-WS runtime to use SOAP 1.2 for that endpoint.

If you are starting from WSDL and packaging the wsdl yourself, any one
of the above can be used.
If you are starting from Java and WSDL is generated dynamically at
runtime, JAX-WS requires
binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/",
this is like a extension option to wsdl generation process.

Since you will be packaging the WSDL in the war as you start from WSDL,
any of those two can be used.

thanks,
Rama Pulavarthi


Carl Roberts wrote:
> Also, your samples seem a little different:
>
>
> For the mtom-soap12 sample:
>
> the wsdl show this:
>
> <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>
> The sun-jaxws file shows this:
>
> binding="http://www.w3.org/2003/05/soap/bindings/HTTP/"
>
>
>
>
>
> For the fromwsdl-soap12 sample:
>
> the wsdl shows this:
>
> <soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
>
> The sun-jaxws file shows this:
>
> binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"
>
>
>
>
> Which one is right?
>
>
>
> Thanks,
>
>
> Joe
>
> -----Original Message-----
> From: Carl Roberts [mailto:carl.roberts@oracle.com]
> Sent: Friday, June 19, 2009 9:31 AM
> To: 'users@metro.dev.java.net'
> Subject: Question about SOAP 1.2 support
>
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Rama Pulavarthi
Re: Question about SOAP 1.2 support
Posted: Jun 19, 2009 8:40 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Carl Roberts wrote:
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
If you are using SOAPBinding, it will accept SOAP 1.1 or SOAP 1.2 but
not both. A version mismatch fault is thrown by endpoint.
If you want your service to accept both SOAP 1.1 and SOAP 1.2, you can
use Provider and may be XML/HTTP binding which lets you play with the
whole envelope as xml.

> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
>
When you do wsimport on a SOAP 1.2 wsdl, you should pass -extension option.
This is required because WSDL binding for SOAP 1.2 is not standardized
and wsimport requires extension option to proceed with non standard binding.
Try passing extension option of wsimport.

thanks,
Rama Pulavarthi
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Carl Roberts
RE: Question about SOAP 1.2 support
Posted: Jun 19, 2009 11:37 AM   in response to: Rama Pulavarthi
  Click to reply to this thread Reply

Hi Rama,

I tried this on by setting extension="true" in the build.xml file for the client and server.

I now get this for command "ant server":

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl



But the project builds and the DocumentServicePortyType.java class is now generated.

For command "ant client" I get errors:

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Can not generate Async methods for non-soap binding!
[wsimport] line 38 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]


client:
[javac] Compiling 1 source file to c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\build\classes
[javac] c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java:285: cannot fin
d symbol
[javac] symbol : method doCallIDSAsync(com.oracle.webservices.documentservice.DoCallIDSRequest,com.oracle.webservices.documentservice.client.DocumentServiceClient.Do
CallIDSCallbackHandler)
[javac] location: interface com.oracle.webservices.documentservice.client.DocumentServicePortType
[javac] Future<?> response = proxy.doCallIDSAsync(req, cbHandler);
[javac] ^
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses or o
verrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses unch
ecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error

BUILD FAILED


It looks like my Async code is no longer being generated - this was working before prior to making WSDL and build changes to use SOAP 1.2?

Here is my custom-client.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="DocumentService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<package name="com.oracle.webservices.documentservice.client"/>
</bindings>
<bindings node="wsdl:definitions/wsdl:portType[@name='DocumentServicePortType']/wsdl:operation[@name='DoCallIDS']">
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
</bindings>

Questions:

1 - How do I solve this new error, when compiling the client side?

2 - Should I be using xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/", xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" or xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd" in the WSDL?

3 - If SOAP v1.2 is not a standard yet, is there a way to use SOAPv 1.1 on the Metro service side and use a .NET client that can talk to it and use WS-Addressing? It seems that when I do this I get the following two exceptions which is why I started exploring using SOAP v1.2 on the Metro side?

Error on service side (Tomcat):

Jun 19, 2009 10:20:43 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
SEVERE: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope
com.sun.xml.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got ht
tp://www.w3.org/2003/05/soap-envelope
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:178)
at com.sun.xml.ws.encoding.MtomCodec.decode(MtomCodec.java:248)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:409)
at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:181)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:352)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
---[HTTP response 500]---


Error on .NET client side:

c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\csharp-client>DocumentServiceClient.exe
Exception: The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 (http://www.w3.org
/2003/05/soap-envelope)). Make sure the binding is configured with the same version as the expected messages.
Parameter name: reader


-----Original Message-----
From: Rama.Pulavarthi@Sun.COM [mailto:Rama.Pulavarthi@Sun.COM]
Sent: Friday, June 19, 2009 11:41 AM
To: users@metro.dev.java.net
Subject: Re: Question about SOAP 1.2 support

Carl Roberts wrote:
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
If you are using SOAPBinding, it will accept SOAP 1.1 or SOAP 1.2 but not both. A version mismatch fault is thrown by endpoint.
If you want your service to accept both SOAP 1.1 and SOAP 1.2, you can use Provider and may be XML/HTTP binding which lets you play with the whole envelope as xml.

> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
>
When you do wsimport on a SOAP 1.2 wsdl, you should pass -extension option.
This is required because WSDL binding for SOAP 1.2 is not standardized and wsimport requires extension option to proceed with non standard binding.
Try passing extension option of wsimport.

thanks,
Rama Pulavarthi
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
>
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Carl Roberts
RE: Question about SOAP 1.2 support
Posted: Jun 19, 2009 11:39 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

And one more quick question to add to the previous 3:

4 - Are these WARNINGS from wsimport expected and OK?

-----Original Message-----
From: Carl Roberts [mailto:carl.roberts@oracle.com]
Sent: Friday, June 19, 2009 2:37 PM
To: 'Rama.Pulavarthi@Sun.COM'; 'users@metro.dev.java.net'
Subject: RE: Question about SOAP 1.2 support

Hi Rama,

I tried this on by setting extension="true" in the build.xml file for the client and server.

I now get this for command "ant server":

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl



But the project builds and the DocumentServicePortyType.java class is now generated.

For command "ant client" I get errors:

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Can not generate Async methods for non-soap binding!
[wsimport] line 38 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]


client:
[javac] Compiling 1 source file to c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\build\classes
[javac] c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java:285: cannot fin d symbol
[javac] symbol : method doCallIDSAsync(com.oracle.webservices.documentservice.DoCallIDSRequest,com.oracle.webservices.documentservice.client.DocumentServiceClient.Do
CallIDSCallbackHandler)
[javac] location: interface com.oracle.webservices.documentservice.client.DocumentServicePortType
[javac] Future<?> response = proxy.doCallIDSAsync(req, cbHandler);
[javac] ^
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses or o verrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses unch ecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error

BUILD FAILED


It looks like my Async code is no longer being generated - this was working before prior to making WSDL and build changes to use SOAP 1.2?

Here is my custom-client.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="DocumentService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<package name="com.oracle.webservices.documentservice.client"/>
</bindings>
<bindings node="wsdl:definitions/wsdl:portType[@name='DocumentServicePortType']/wsdl:operation[@name='DoCallIDS']">
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
</bindings>

Questions:

1 - How do I solve this new error, when compiling the client side?

2 - Should I be using xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/", xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" or xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd" in the WSDL?

3 - If SOAP v1.2 is not a standard yet, is there a way to use SOAPv 1.1 on the Metro service side and use a .NET client that can talk to it and use WS-Addressing? It seems that when I do this I get the following two exceptions which is why I started exploring using SOAP v1.2 on the Metro side?

Error on service side (Tomcat):

Jun 19, 2009 10:20:43 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
SEVERE: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope
com.sun.xml.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got ht tp://www.w3.org/2003/05/soap-envelope
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:178)
at com.sun.xml.ws.encoding.MtomCodec.decode(MtomCodec.java:248)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:409)
at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:181)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:352)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
---[HTTP response 500]---


Error on .NET client side:

c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\csharp-client>DocumentServiceClient.exe
Exception: The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 (http://www.w3.org /2003/05/soap-envelope)). Make sure the binding is configured with the same version as the expected messages.
Parameter name: reader


-----Original Message-----
From: Rama.Pulavarthi@Sun.COM [mailto:Rama.Pulavarthi@Sun.COM]
Sent: Friday, June 19, 2009 11:41 AM
To: users@metro.dev.java.net
Subject: Re: Question about SOAP 1.2 support

Carl Roberts wrote:
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
If you are using SOAPBinding, it will accept SOAP 1.1 or SOAP 1.2 but not both. A version mismatch fault is thrown by endpoint.
If you want your service to accept both SOAP 1.1 and SOAP 1.2, you can use Provider and may be XML/HTTP binding which lets you play with the whole envelope as xml.

> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
>
When you do wsimport on a SOAP 1.2 wsdl, you should pass -extension option.
This is required because WSDL binding for SOAP 1.2 is not standardized and wsimport requires extension option to proceed with non standard binding.
Try passing extension option of wsimport.

thanks,
Rama Pulavarthi
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
>
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Carl Roberts
RE: Question about SOAP 1.2 support
Posted: Jun 23, 2009 5:23 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Hi Rama,

I know you probably get a lot of questions and have to go through then in the order received...:) I just want to make sure this one is not missed. When you have moment could you please answer my questions below?

Thanks,


Joe

-----Original Message-----
From: Carl Roberts [mailto:carl.roberts@oracle.com]
Sent: Friday, June 19, 2009 2:37 PM
To: 'Rama.Pulavarthi@Sun.COM'; 'users@metro.dev.java.net'
Subject: RE: Question about SOAP 1.2 support

Hi Rama,

I tried this on by setting extension="true" in the build.xml file for the client and server.

I now get this for command "ant server":

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl



But the project builds and the DocumentServicePortyType.java class is now generated.

For command "ant client" I get errors:

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Can not generate Async methods for non-soap binding!
[wsimport] line 38 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]


client:
[javac] Compiling 1 source file to c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\build\classes
[javac] c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java:285: cannot fin d symbol
[javac] symbol : method doCallIDSAsync(com.oracle.webservices.documentservice.DoCallIDSRequest,com.oracle.webservices.documentservice.client.DocumentServiceClient.Do
CallIDSCallbackHandler)
[javac] location: interface com.oracle.webservices.documentservice.client.DocumentServicePortType
[javac] Future<?> response = proxy.doCallIDSAsync(req, cbHandler);
[javac] ^
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses or o verrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses unch ecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error

BUILD FAILED


It looks like my Async code is no longer being generated - this was working before prior to making WSDL and build changes to use SOAP 1.2?

Here is my custom-client.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="DocumentService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<package name="com.oracle.webservices.documentservice.client"/>
</bindings>
<bindings node="wsdl:definitions/wsdl:portType[@name='DocumentServicePortType']/wsdl:operation[@name='DoCallIDS']">
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
</bindings>

Questions:

1 - How do I solve this new error, when compiling the client side?

2 - Should I be using xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/", xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" or xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd" in the WSDL?

3 - If SOAP v1.2 is not a standard yet, is there a way to use SOAPv 1.1 on the Metro service side and use a .NET client that can talk to it and use WS-Addressing? It seems that when I do this I get the following two exceptions which is why I started exploring using SOAP v1.2 on the Metro side?

Error on service side (Tomcat):

Jun 19, 2009 10:20:43 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
SEVERE: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope
com.sun.xml.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got ht tp://www.w3.org/2003/05/soap-envelope
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:178)
at com.sun.xml.ws.encoding.MtomCodec.decode(MtomCodec.java:248)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:409)
at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:181)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:352)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
---[HTTP response 500]---


Error on .NET client side:

c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\csharp-client>DocumentServiceClient.exe
Exception: The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 (http://www.w3.org /2003/05/soap-envelope)). Make sure the binding is configured with the same version as the expected messages.
Parameter name: reader


-----Original Message-----
From: Rama.Pulavarthi@Sun.COM [mailto:Rama.Pulavarthi@Sun.COM]
Sent: Friday, June 19, 2009 11:41 AM
To: users@metro.dev.java.net
Subject: Re: Question about SOAP 1.2 support

Carl Roberts wrote:
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
If you are using SOAPBinding, it will accept SOAP 1.1 or SOAP 1.2 but not both. A version mismatch fault is thrown by endpoint.
If you want your service to accept both SOAP 1.1 and SOAP 1.2, you can use Provider and may be XML/HTTP binding which lets you play with the whole envelope as xml.

> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
>
When you do wsimport on a SOAP 1.2 wsdl, you should pass -extension option.
This is required because WSDL binding for SOAP 1.2 is not standardized and wsimport requires extension option to proceed with non standard binding.
Try passing extension option of wsimport.

thanks,
Rama Pulavarthi
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
>
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Carl Roberts
RE: Question about SOAP 1.2 support
Posted: Jun 23, 2009 6:00 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Just FYI,

For #2: The answer seems to be xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/", because when I use this value in the WSLD, I only get this warning on the server and client side and both sides now compile:

[wsimport] [WARNING] SOAP port "DocumentServicePort": uses a non-standard SOAP 1.2 binding.
[wsimport] line 115 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]

However, this was very confusing for me because the URL http://schemas.xmlsoap.org/wsdl/soap12/ is not a URL to a schema document but to an HTML page that contains several links to schema documents...:)

#2 also solves #1.

Could you please answer #3 when you have a moment?

Thanks,

Joe



-----Original Message-----
From: Carl Roberts [mailto:carl.roberts@oracle.com]
Sent: Tuesday, June 23, 2009 8:24 AM
To: 'carl.roberts@oracle.com'; 'Rama.Pulavarthi@Sun.COM'; 'users@metro.dev.java.net'
Subject: RE: Question about SOAP 1.2 support

Hi Rama,

I know you probably get a lot of questions and have to go through then in the order received...:) I just want to make sure this one is not missed. When you have moment could you please answer my questions below?

Thanks,


Joe

-----Original Message-----
From: Carl Roberts [mailto:carl.roberts@oracle.com]
Sent: Friday, June 19, 2009 2:37 PM
To: 'Rama.Pulavarthi@Sun.COM'; 'users@metro.dev.java.net'
Subject: RE: Question about SOAP 1.2 support

Hi Rama,

I tried this on by setting extension="true" in the build.xml file for the client and server.

I now get this for command "ant server":

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl



But the project builds and the DocumentServicePortyType.java class is now generated.

For command "ant client" I get errors:

[wsimport] [WARNING] port "DocumentServicePort" is not a SOAP port, it has no soap:address
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] port "DocumentServicePort": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
[wsimport] line 88 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] soap:fault name not specified, wsdl:fault "DoCallIDSFault" in operation "DoCallIDS"
[wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]
[wsimport] [WARNING] Can not generate Async methods for non-soap binding!
[wsimport] line 38 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
[wsimport]


client:
[javac] Compiling 1 source file to c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\build\classes
[javac] c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java:285: cannot fin d symbol
[javac] symbol : method doCallIDSAsync(com.oracle.webservices.documentservice.DoCallIDSRequest,com.oracle.webservices.documentservice.client.DocumentServiceClient.Do
CallIDSCallbackHandler)
[javac] location: interface com.oracle.webservices.documentservice.client.DocumentServicePortType
[javac] Future<?> response = proxy.doCallIDSAsync(req, cbHandler);
[javac] ^
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses or o verrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\src\com\oracle\webservices\documentservice\client\DocumentServiceClient.java uses unch ecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error

BUILD FAILED


It looks like my Async code is no longer being generated - this was working before prior to making WSDL and build changes to use SOAP 1.2?

Here is my custom-client.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="DocumentService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<package name="com.oracle.webservices.documentservice.client"/>
</bindings>
<bindings node="wsdl:definitions/wsdl:portType[@name='DocumentServicePortType']/wsdl:operation[@name='DoCallIDS']">
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
</bindings>

Questions:

1 - How do I solve this new error, when compiling the client side?

2 - Should I be using xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/", xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" or xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd" in the WSDL?

3 - If SOAP v1.2 is not a standard yet, is there a way to use SOAPv 1.1 on the Metro service side and use a .NET client that can talk to it and use WS-Addressing? It seems that when I do this I get the following two exceptions which is why I started exploring using SOAP v1.2 on the Metro side?

Error on service side (Tomcat):

Jun 19, 2009 10:20:43 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
SEVERE: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope
com.sun.xml.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got ht tp://www.w3.org/2003/05/soap-envelope
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:178)
at com.sun.xml.ws.encoding.MtomCodec.decode(MtomCodec.java:248)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:409)
at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:181)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:352)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
---[HTTP response 500]---


Error on .NET client side:

c:\devtools\tools\java-tools\exe\metro\myprojects\documentservice\csharp-client>DocumentServiceClient.exe
Exception: The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 (http://www.w3.org /2003/05/soap-envelope)). Make sure the binding is configured with the same version as the expected messages.
Parameter name: reader


-----Original Message-----
From: Rama.Pulavarthi@Sun.COM [mailto:Rama.Pulavarthi@Sun.COM]
Sent: Friday, June 19, 2009 11:41 AM
To: users@metro.dev.java.net
Subject: Re: Question about SOAP 1.2 support

Carl Roberts wrote:
> Hi,
>
> I am trying to run a .net csharp client to test WS-Addressing againts a Metro 2.0 web service. I noticed that for this to work I needed to us wsHttpBinding instead of the basicHttpBinding on the .net client .config file. Problem is that the SOAP version seems to be 1.2 for this; it seems the service could not understand the SOAP 1.2 envelope since the service is using SOAP 1.1.
>
> Questions:
>
> 1 - Is there a way to make a service using SOAP 1.1 understand messages with a SOAP envelope v1.2? How do you guys test this?
>
If you are using SOAPBinding, it will accept SOAP 1.1 or SOAP 1.2 but not both. A version mismatch fault is thrown by endpoint.
If you want your service to accept both SOAP 1.1 and SOAP 1.2, you can use Provider and may be XML/HTTP binding which lets you play with the whole envelope as xml.

> 2 - I also tried to convert the service to use SOAP v 1.2, based on the example you provided mtom-soap12. The wsdl in that example uses this namespace:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>
>
When you do wsimport on a SOAP 1.2 wsdl, you should pass -extension option.
This is required because WSDL binding for SOAP 1.2 is not standardized and wsimport requires extension option to proceed with non standard binding.
Try passing extension option of wsimport.

thanks,
Rama Pulavarthi
> But when I change my wsdl to use that namespace I get this error from wsimport:
>
> [wsimport]
> [wsimport] [WARNING] Ignoring SOAP port "DocumentServicePort": it uses non-standard SOAP 1.2 binding.
> [wsimport] You must specify the "-extension" option to use this binding.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
> I opened the http://schemas.xmlsoap.org/wsdl/soap12/ URL in a browser and it is not a link to an xsd file but an html page with links to different xsd's. So I changed the namespace as follows:
>
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
>
>
> But now I get this error from wsimport:
>
>
> [wsimport] [WARNING] ignoring port "DocumentServicePort": no SOAP address specified. try running wsimport with -extension switch.
> [wsimport] line 86 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] [WARNING] Service "DocumentService" does not contain any usable ports. try running wsimport with -extension switch.
> [wsimport] line 85 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
> [wsimport]
> [wsimport] generating code...
>
> How do I solve this error or create a service that does use SOAP 1.2?
>
>
> Here is my WSDL content:
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:sch="http://oracle.com/webservices/documentservice"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd"
> xmlns:tns="http://oracle.com/webservices/documentservice"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
>
> targetNamespace="http://oracle.com/webservices/documentservice">
>
>
> <wsdl:types>
> <xsd:schema>
> <xsd:import schemaLocation="DocumentService.xsd" namespace="http://oracle.com/webservices/documentservice"/>
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="DoCallIDSRequest">
> <wsdl:part name="DoCallIDSRequest" element="tns:DoCallIDSRequest"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSResponse">
> <wsdl:part name="DoCallIDSResponse" element="tns:DoCallIDSResponse"/>
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSFault">
> <wsdl:part name="DoCallIDSFault" element="tns:DoCallIDSFault" />
> </wsdl:message>
>
> <wsdl:message name="DoCallIDSOneWayRequest">
> <wsdl:part name="DoCallIDSOneWayRequest" element="tns:DoCallIDSOneWayRequest"/>
> </wsdl:message>
>
>
> <wsdl:portType name="DocumentServicePortType">
>
> <wsdl:operation name="DoCallIDS">
> <wsdl:input message="tns:DoCallIDSRequest"/>
> <wsdl:output message="tns:DoCallIDSResponse"/>
> <wsdl:fault name="DoCallIDSFault" message="tns:DoCallIDSFault"/>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <wsdl:input message="tns:DoCallIDSOneWayRequest"/>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DocumentServiceBinding" type="tns:DocumentServicePortType">
> <wsaw:UsingAddressing wsdl:required="false"/>
> <soap12:binding
> style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="DoCallIDS">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSRequest"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="DoCallIDSFault">
> <soap12:fault name="DoCallIDSFault" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
>
> <wsdl:operation name="DoCallIDSOneWay">
> <soap12:operation
> soapAction="http://oracle.com/webservices/documentservice/DocumentServicePortType/DoCallIDSOneWayRequest"
> soapActionRequired="false"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> </wsdl:operation>
>
> </wsdl:binding>
>
>
> <wsdl:service name="DocumentService">
> <wsdl:port name="DocumentServicePort" binding="tns:DocumentServiceBinding">
> <soap12:address location="http://localhost:8080/oracle-document-service/service"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net


Rama Pulavarthi
Re: Question about SOAP 1.2 support
Posted: Jun 23, 2009 11:35 AM   in response to: Carl Roberts
  Click to reply to this thread Reply

Hi,

> [wsimport] [WARNING] fault "DoCallIDSFault" in operation "DoCallIDS" does not have a SOAP fault extension
> [wsimport] line 68 of file:/C:/devtools/tools/java-tools/exe/metro/myprojects/documentservice/etc/DocumentService.wsdl
>
>
Please attach your wsdl. Looks like it has some problems and wsimport is
able to proceed only with -extension option by ignoring them.
>
>
>
> It looks like my Async code is no longer being generated - this was working before prior to making WSDL and build changes to use SOAP 1.2?
>
>
Async Mapping should work with SOAP 1.1/1.2 binding, Please file a bug
if it does not.
The easiest would be to attach the wsdl and customization file so that I
can try sometime.
> 1 - How do I solve this new error, when compiling the client side?
>
> 2 - Should I be using xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/", xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" or xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/wsdl11soap12.xsd" in the WSDL?
>
>
Seems you figured these two out from the other emails.
> 3 - If SOAP v1.2 is not a standard yet, is there a way to use SOAPv 1.1 on the Metro service side and use a .NET client that can talk to it and use WS-Addressing? It seems that when I do this I get the following two exceptions which is why I started exploring using SOAP v1.2 on the Metro side?
>
>
Only WSDL binding for SOAP 1.2 is not standard yet. You should be using
same version on both server and client. Metro and .NET interoperate with
both versions irrespective of WS-Addressing is used or not.

I suspect you are configuring the endpoint incorrectly.
Its ugly I know, but as per the spec, Runtime uses the binding
configured on impl or descriptor and not from whats specified in wsdl.
As mentioned before, you should use
binding="http://www.w3.org/2003/05/soap/bindings/HTTP/" in deployment
descriptor (sun-jaxws.xml) or
@BindingType("http://www.w3.org/2003/05/soap/bindings/HTTP/") on your
endpoint implementation though your wsdl says it is SOAP 1.2. Please see
fromwsdl-soap12 sample in RI.

I think this should solve your problem.

thanks,
Rama Pulavarthi


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net





 XML java.net RSS