Hi all,

I'm trying to write a client for web service using Jbossws JAX-WS.
My purpose is that I want only on client for two services provider.

I generated the static part of the client with wsconsume.
My client code look like this :


public class StubClient
{

   public static void main (String[] args) throws Exception {
       IService1 port;
       try {
         

          port = new namespace.Service1(new URL("file:///home/project/resources/service1.wsdl"), new QName("http://namespace/", "service1")).getBasicHttpBindingIService1();
          System.out.println(port.getOperation());

       } catch (Exception e) {
           e.printStackTrace();
       }
   }
}

My local wsdl look like this:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="service1" targetNamespace="http://namespace/" xmlns:tns="http://namespace/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract">
  <wsdl:types>
    <xsd:schema targetNamespace="http://namespace/Imports">
            <xsd:import namespace="http://namespace/" schemaLocation="xsd0.xsd"/>
            <xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" schemaLocation="xsd1.xsd"/>
        </xsd:schema>
  </wsdl:types>
  <wsdl:message name="IService1_GetOperation_OutputMessage">
    <wsdl:part name="parameters" element="tns:GetOperationResponse">
    </wsdl:part>
  </wsdl:message>
 
  <wsdl:portType name="IService1">
    <wsdl:operation name="GetOperation">
      <wsdl:input message="tns:IService1_GetOperation_InputMessage" wsaw:Action="http://namespace/IService1/GetValidationServiceStatus">
    </wsdl:input>
      <wsdl:output message="tns:IService1_GetOperation_OutputMessage" wsaw:Action="http://namespace/IService1/GetValidationServiceStatusResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="BasicHttpBinding_IService1" type="tns:IService1">
    <wsp:PolicyReference URI="#BasicHttpBinding_IService1_policy"/>
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="GetOperation">
      <soap:operation soapAction="http://namespace/IService1/GetOperation" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="service1">
    <wsdl:port name="BasicHttpBinding_IService1" binding="tns:BasicHttpBinding_IService1">
      <soap:address location="http://localhost:8090/service1"/>
    </wsdl:port>
  </wsdl:service>
    <wsp:Policy wsu:Id="BasicHttpBinding_IService1_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
</wsdl:definitions>

When I run my client, I got this error :

org.jboss.ws.WSException: Policy not supported! #BasicHttpBinding_IService1_policy
    at org.jboss.ws.WSException.rethrow(WSException.java:60)
    at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicyClientSide(PolicyMetaDataBuilder.java:316)
    at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicy(PolicyMetaDataBuilder.java:274)
    at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.processPolicies(PolicyMetaDataBuilder.java:233)
    at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.processPolicyExtensions(PolicyMetaDataBuilder.java:190)
    at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:94)
    at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
    at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:64)
    at javax.xml.ws.Service.<init>(Service.java:81)
    at gazelle.net.ihe.Service1.<init>(Service1.java:43)
    at gazelle.net.ihe.StubClient.main(StubClient.java:20)
Caused by: org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy
    at org.jboss.ws.extensions.policy.deployer.PolicyDeployer.deployClientSide(PolicyDeployer.java:174)
    at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicyClientSide(PolicyMetaDataBuilder.java:307)
    ... 9 more


Did somebody have a clue for me?
Thanks for your reply

JF


Venez découvrir des milliers de célibataires dans votre région et affinez vos recherches grâce à tous les services mis à votre disposition: recherche, annonce vocale, messagerie, photos...
>Cliquez ici