十万火急:VC调用 webService 认证的问题

oO临时工Oo 2011-06-14 02:35:53
现在VC程序调用 java(AXIS)有webservice
现在WS有认证,用户名和密码的简单认证

在VC里面怎么以送认证信息。

工作现场,在线等待十万火急十万火急十万火急
...全文
138 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
oO临时工Oo 2011-07-07
  • 打赏
  • 举报
回复
对应的实现类:


public class SayHello {

public String hello(String name){
return "Hello "+name;
}

public void in(String name){
System.out.println(name + "come");
Log4j.getLogger().info(name + "come");
}
}

oO临时工Oo 2011-07-07
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 tr0j4n 的回复:]
现在VC程序调用 java(AXIS)有webservice
现在WS有认证,用户名和密码的简单认证

在VC里面怎么以送认证信息。
-----------------------------------
1、贴出WSDL声明
2、你说的WS是什么?WebSphere?
[/Quote]

2.WS 指webservice ,服务器端webservice用AXIS2部署。
1. WSDL如下

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/DemoLanZhou/services/WSTest1" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/DemoLanZhou/services/WSTest1" xmlns:intf="http://localhost:8080/DemoLanZhou/services/WSTest1" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->

<wsdl:message name="inRequest">

<wsdl:part name="name" type="xsd:string"/>

</wsdl:message>

<wsdl:message name="helloResponse">

<wsdl:part name="helloReturn" type="xsd:string"/>

</wsdl:message>

<wsdl:message name="helloRequest">

<wsdl:part name="name" type="xsd:string"/>

</wsdl:message>

<wsdl:message name="inResponse">

</wsdl:message>

<wsdl:portType name="SayHello">

<wsdl:operation name="hello" parameterOrder="name">

<wsdl:input message="impl:helloRequest" name="helloRequest"/>

<wsdl:output message="impl:helloResponse" name="helloResponse"/>

</wsdl:operation>

<wsdl:operation name="in" parameterOrder="name">

<wsdl:input message="impl:inRequest" name="inRequest"/>

<wsdl:output message="impl:inResponse" name="inResponse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="WSTest1SoapBinding" type="impl:SayHello">

<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="hello">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="helloRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tp.lz.trimps.org" use="encoded"/>

</wsdl:input>

<wsdl:output name="helloResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/DemoLanZhou/services/WSTest1" use="encoded"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="in">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="inRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tp.lz.trimps.org" use="encoded"/>

</wsdl:input>

<wsdl:output name="inResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/DemoLanZhou/services/WSTest1" use="encoded"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="SayHelloService">

<wsdl:port binding="impl:WSTest1SoapBinding" name="WSTest1">

<wsdlsoap:address location="http://localhost:8080/DemoLanZhou/services/WSTest1"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>



服务器WS发布如下


<service name="WSTest1" provider="java:RPC">
<parameter name="className" value="lz.tp.SayHello"/>
<parameter name="allowedMethods" value="*"/>
<requestFlow>
<!-- 认证方式 -->
<handler name="authen" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
</requestFlow>
</service>


事情已过,继续等待高手解答。
ouwarmth 2011-07-04
  • 打赏
  • 举报
回复
认证信息可以以参数的形式传递,即写java写的webservice函数里多加认证信息的参数就可以了吧~
MoXiaoRab 2011-07-02
  • 打赏
  • 举报
回复
现在VC程序调用 java(AXIS)有webservice
现在WS有认证,用户名和密码的简单认证

在VC里面怎么以送认证信息。
-----------------------------------
1、贴出WSDL声明
2、你说的WS是什么?WebSphere?
Yofoo 2011-07-02
  • 打赏
  • 举报
回复
用java写个例子, 抓个包一目了然
oO临时工Oo 2011-06-15
  • 打赏
  • 举报
回复
继续等待。。。。
chenjiawei007 2011-06-15
  • 打赏
  • 举报
回复
看下java的用户名密码是封装在html的什么部位的,然后用SOAP或者Gsoap进行相关的封装。

gsoap估计需要自己去眼镜底层的接口,网上资料基本没有。前阵子java的朋友也问我这样行不行,

当初粗粗的看了下gsoap接口,应该是可以的,因为提供接口非常丰富
yynetsdk 2011-06-15
  • 打赏
  • 举报
回复
用ide添加web引用
oyljerry 2011-06-15
  • 打赏
  • 举报
回复
用java方式,那就要查看一下调用方式是否提供设置的函数

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧