0

Trying up upgrade our procedure of generating jar file from wsdl. We were using AXIS2 and would like to start using CXF with then upgrading of Java on our system.

Using the command line: Caused by {http://maximus.com/assetworks/fmax-wsdl}[message:integer] not exist. The wsdl contains:

  <portType name='getNextLinkTranxNumPortType'>
    <operation name='getNextLinkTranxNum'>
      <input message='tns:getNextLinkTranxNum'/>
      <output message='tns:integer'/>
      <fault name='exception' message='tns:exception'/>
    </operation>
  </portType>

So I tried to create a bindings.xml file to define integer:

<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://apache.org/cxf/wsdl/extensions/binding"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          wsdlLocation="https://aimDEV2.fs.illinois.edu/fmax/wsdl/fmax-wsdl.wsdl">
    
    <!-- Example: Modify SOAP Binding -->
    <wsdl:binding name="MyServiceSoapBinding">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    </wsdl:binding>
    
    <jxb:bindings version="2.1" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
                  xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <jxb:bindings schemaLocation="https://aimDEV2.fs.illinois.edu/fmax/wsdl/fmax-web-services.xsd">
            <jxb:bindings node="//xs:element[@name='integer']">
                <jxb:javaType name="java.lang.Integer"/>
            </jxb:bindings>
        </jxb:bindings>
    </jxb:bindings>
</bindings>

Using the following command line: wsdl2java -verbose -keep -d c:\users\snelliga\dev2.jar -p com.example.generated -xjc -exsh true -b bindings.xml https://aimDEV2.fs.illinois.edu/fmax/wsdl/fmax-wsdl.wsdl

Now I'm getting the error:WSDLToJava Error: Not a valid jaxb or jaxws binding file, please check the namespace

How can I fix this?

Thanks in advance, -Steve Nelligan

researching on web and with ChatCPT

Need to create java pojo from wsdl

1 Answer 1

0

You appear to have the wrong namespace for the binding file.

See https://cxf.apache.org/docs/wsdl-to-java.html.

Assuming CXF 4.0:

<bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="hello_world.wsdl"
    xmlns="https://jakarta.ee/xml/ns/jaxws">
    <bindings node="wsdl:definitions/wsdl:portType[@name='GreeterSE']">
    <class name="GreeterSEI"/>
    </bindings>
</bindings>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.