How to generate a java web service class to a WSDL-file that works with sudzc.com to create objective-C code?

1.5k Views Asked by At

How can I generate from a Java Web Service class a WSDL-file, which is supported by Sudzc.com to generate a Objective-C code?

I tried it with a simple example.

My Java Web Service class:

package main;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

@WebService(name="RectangleWebService", serviceName = "RectangleWebService", portName = "RectangleWebServicePort", targetNamespace = "http://www.mywstest.com/ws/rectangle")
public class RectangleService {
    @WebMethod(action="calculateValueOne")
    public @WebResult(name="ValueOne") float calculateValueOne(@WebParam(name="Length") float length, @WebParam(name="Width")float width){
        return 2*(length+width);
    }
    @WebMethod(action="calculateValueTwo")
    public @WebResult(name="ValueTwo") float calculateValueTwo(@WebParam(name="Length") float length, @WebParam(name="Width")float width){
        return (length*width);
    }

}

I create a WSDL-file with an ant-script and wsgen and then I uploaded it on http://sudzc.com to create the Objective-C code (Objective-C for iOS with ARC). My Problem is that the created Objective-C code from Sudzc.com has no instance Methods...

This is my WSDL-file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. -->
<definitions targetNamespace="http://www.mywstest.com" name="RectangleWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.mywstest.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <import namespace="http://www.mywstest.com/ws/rectangle" location="RectangleWebServicePortType.wsdl"/>
  <binding name="RectangleWebServicePortBinding" type="ns1:RectangleWebService" xmlns:ns1="http://www.mywstest.com/ws/rectangle">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="calculateValueOne">
      <soap:operation soapAction="calculateValueOne"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="calculateValueTwo">
      <soap:operation soapAction="calculateValueTwo"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="RectangleWebService">
    <port name="RectangleWebServicePort" binding="tns:RectangleWebServicePortBinding">
      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
    </port>
  </service>
</definitions>

When I use the WSDL-file from http://www.w3schools.com/webservices/tempconvert.asmx?WSDL to generate the Objective-C code with sudzc.com, it works fine and I can use the instance methods of the web service in my Objective-C project... !!!

Perhaps someone can help?

P.S. Sorry for my bad english and I am an absolute beginner in web services...

2

There are 2 best solutions below

0
On

The problem is that the generated RectangleWebService.wsdl file has a schema import from an external schema1.xsd file...

So i have to create one wsdl-file and then it should work with sudzc.com...

Is my guess right?

0
On

That sudzC has a lot of issues with memory, I use WSClient++ to generate the classes and never had a problem.

http://wsclient.neurospeech.com/