1

I have a requirement to generate client proxy java files in Eclipse IDE.

I tried to generate this via wsimport command. Below is the command I used.

wsimport -keep -b bindings.xml -p com.aasc.carrier.shipexec.proxy -implServiceName wcfSoxContract -implPortName wcfShip http://shipexec.com/demo/wcf/soap?wsdl -B-XautoNameResolution

After executing this I am getting below issue.

[ERROR] Invalid operation "InstantiateWCF", can't generate java method parameter. Local name of the wrapper child "package" in the global element "{......}InstantiateWCF" is a java keyword. Use customization to change the parametername. line 1 of http://shipexec.com/demo/wcf/soap?wsdl=wsdl0

I tried to resolve this issue using the custom binding xml file as below.

<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                wsdlLocation="http://shipexec.com/demo/wcf/soap?wsdl">
  <enableWrapperStyle>false</enableWrapperStyle>
  <jaxws:bindings node="wsdl:definitions/wsdl:import/wsdl:portType[@name='IwcfShip']/wsdl:operation[@name='InstantiateWCF']">
    <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='IwcfShip_InstantiateWCF_InputMessage']/wsdl:part[@name='parameters']" childElementName="package" name="paramPackage" />
  </jaxws:bindings>
</jaxws:bindings>

But the node I am trying to get is not recognizing.

Can anyone please help on finding the exact node path for changing the name of the parameter for 'InstantiateWCF' operation.

Thanks, Y Pradeep

1 Answer 1

0

I have resolved this issue by changing binding.xml file to as below.

<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
    wsdlLocation="http://shipexec.com/demo/wcf/soap?wsdl=wsdl0">
    <jaxws:bindings node="wsdl:definitions" >
        <jaxws:bindings node="//wsdl:portType[@name='IwcfShip']/wsdl:operation[@name='InstantiateWCF']">
             <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='IwcfShip_InstantiateWCF_InputMessage']/wsdl:part[@name='parameters']" childElementName="tns:package" name="paramPackage" />
        </jaxws:bindings>
    </jaxws:bindings>
</jaxws:bindings>

And also modified wsimport command as below.

wsimport -keep -p com.aasc.carrier.shipexec.proxy -implServiceName wcfSoxContract -implPortName wcfShip http://shipexec.com/demo/wcf/soap?wsdl -B-XautoNameResolution -b bindings.xml

Thanks, Y Pradeep

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.