简体   繁体   English

在没有WSDL2OBJC和Sudz C的情况下,将Java中的Web服务与SOAP客户端目标C连接起来?

[英]Connect Web Service in Java with SOAP Client Objective C without WSDL2OBJC and Sudz C?

I have this web service in Java: 我在Java中有以下Web服务:

@WebService(serviceName = "Catalogo_V1")
public class Catalogo_V1 {

    /** This is a sample web service operation */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) 
    {
        System.out.println("kkk"+txt);
        if(txt != null)
        {
            txt= txt +"www";
        }

        return "Hello " + txt + " !";
    }

}

I have tryed with WSDL2OBJ and dont send my parameters, finally i have decided change and probe with other tecnology. 我尝试使用WSDL2OBJ,并且不发送参数,最后我决定进行更改,并尝试使用其他技术。

Can someone help me??? 有人能帮我吗???

If you are looking for an alternative to something like SudzC, you can always work with simple SOAP interfaces by hand. 如果您正在寻找SudzC之类的替代产品,则始终可以随时使用简单的SOAP接口。 It's really not that hard to do, but it does require you to generate the outgoing XML and parse the incoming XML yourself. 确实并非难事,但确实需要您生成传出的XML并自己解析传入的XML。

When I've done this, I've managed it by creating "template" versions of my requests and bundled them with my iOS app. 完成此操作后,我通过创建请求的“模板”版本并将其与我的iOS应用捆绑在一起来进行管理。 When I need to make a request I pull in the template XML file and do some simple string/XML manipulation to insert the parameters into the request XML. 当我需要发出请求时,请拉入模板XML文件并执行一些简单的字符串/ XML操作,以将参数插入请求XML中。 Then I submit the XML request, get the XML response, and parse out the parts of the response I care about. 然后,我提交XML请求,获取XML响应,并解析出我关心的响应部分。

This is not something I would recommend if you are doing lots of different SOAP calls with complex XML inputs or outputs. 如果您要使用复杂的XML输入或输出执行许多不同的SOAP调用,那么我不建议这样做。 But for simple SOAP requests, it works just fine. 但是对于简单的SOAP请求,它就可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM