新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> Web服务(Web Services,WS), 语义Web服务(Semantic Web Services, SWS)讨论区: WSDL, SOAP, UDDI, DAML-S, OWL-S, SWSF, SWSL, WSMO, WSML,BPEL, BPEL4WS, WSFL, WS-*,REST, PSL, Pi-calculus(Pi演算), Petri-net,WSRF,
    [返回] 中文XML论坛 - 专业的XML技术讨论区W3CHINA.ORG讨论区 - Web新技术讨论『 Web Services & Semantic Web Services 』 → [求助]急!!!!!eclipse下调用axis2开发的webservice参数传递为空 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 6207 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助]急!!!!!eclipse下调用axis2开发的webservice参数传递为空 举报  打印  推荐  IE收藏夹 
       本主题类别: Description Logics | Web Services    
     sunny_boy50001 帅哥哟,离线,有人找我吗?魔羯座1984-1-1
      
      
      等级:大一新生
      文章:6
      积分:82
      门派:W3CHINA.ORG
      注册:2007/11/1

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给sunny_boy50001发送一个短消息 把sunny_boy50001加入好友 查看sunny_boy50001的个人资料 搜索sunny_boy50001在『 Web Services & Semantic Web Services 』的所有贴子 引用回复这个贴子 回复这个贴子 查看sunny_boy50001的博客楼主
    发贴心情 [求助]急!!!!!eclipse下调用axis2开发的webservice参数传递为空

    服务端
    public class sendCommon {
     public Boolean sendCommonBillData(String username,String password,String billStr)
     {
      System.out.println(username+ password+billStr);
      return true;
     
     }
    }
    生成的wsdl文件
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://send_DR/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="sendCommonService" targetNamespace="http://send_DR/">
      <types>
        <xsd:schema>
          <xsd:import namespace="http://send_DR/" schemaLocation="SendCommonService_schema1.xsd"/>
        </xsd:schema>
      </types>
      <message name="sendCommonBillData">
        <part element="tns:sendCommonBillData" name="parameters"/>
      </message>
      <message name="sendCommonBillDataResponse">
        <part element="tns:sendCommonBillDataResponse" name="parameters"/>
      </message>
      <portType name="sendCommonDelegate">
        <operation name="sendCommonBillData">
          <input message="tns:sendCommonBillData"/>
          <output message="tns:sendCommonBillDataResponse"/>
        </operation>
      </portType>
      <binding name="sendCommonPortBinding" type="tns:sendCommonDelegate">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="sendCommonBillData">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="sendCommonService">
        <port binding="tns:sendCommonPortBinding" name="sendCommonPort">
          <soap:address location="http://localhost:8080/sendCommonBillData/sendCommonService"/>
        </port>
      </service>
    </definitions>
    生成的xsd文件
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://send_DR/" targetNamespace="http://send_DR/" version="1.0">

      <xs:element name="sendCommonBillData" type="tns:sendCommonBillData"/>

      <xs:element name="sendCommonBillDataResponse" type="tns:sendCommonBillDataResponse"/>

      <xs:complexType name="sendCommonBillData">
        <xs:sequence>
          <xs:element minOccurs="0" name="arg0" type="xs:string"/>
          <xs:element minOccurs="0" name="arg1" type="xs:string"/>
          <xs:element minOccurs="0" name="arg2" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>

      <xs:complexType name="sendCommonBillDataResponse">
        <xs:sequence>
          <xs:element minOccurs="0" name="return" type="xs:boolean"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    访问端-调用方法
    Service service = new Service();
    Call call = (Call)service.createCall();
    String endpoint = "http://192.168.248.102:8080/sendCommonBillData/sendCommonPort?WSDL";
    call.setTargetEndpointAddress(new java.net.URL(endpoint));
    call.setOperationName(new QName("http://send_DR/", "sendCommonBillData"));
    call.addParameter(new QName("http://send_DR/","username"), org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
    call.addParameter(new QName("http://send_DR/","passsword"), org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
    call.addParameter(new QName("http://send_DR/","billStr"), org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
                  
    call.setUseSOAPAction(true);
    call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_BOOLEAN);
    boolean ret = false;
    ret =(Boolean) call.invoke(new Object[]{username,password,billStr});

    结果 nullnullnull


       收藏   分享  
    顶(1)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2011/11/9 18:50:00
     
     sunny_boy50001 帅哥哟,离线,有人找我吗?魔羯座1984-1-1
      
      
      等级:大一新生
      文章:6
      积分:82
      门派:W3CHINA.ORG
      注册:2007/11/1

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给sunny_boy50001发送一个短消息 把sunny_boy50001加入好友 查看sunny_boy50001的个人资料 搜索sunny_boy50001在『 Web Services & Semantic Web Services 』的所有贴子 引用回复这个贴子 回复这个贴子 查看sunny_boy50001的博客2
    发贴心情 
    call.addParameter(new QName("http://send_DR/","arg0"), org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
    这样也不对,有人知道这个地方要怎么写或者怎么改么?
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2011/11/9 21:04:00
     
     GoogleAdSense魔羯座1984-1-1
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Web Services & Semantic Web Services 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/4/29 6:43:10

    本主题贴数2,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    62.500ms