可以不调用WebService端的函数,将客户端生成的二进制流数据发送到WebService服务端吗?该怎么处理
可以不调用WebService端的函数,将客户端生成的二进制流数据发送到WebService服务端吗?
问题1:可以不调用WebService端的函数,将客户端生成的二进制流数据发送到WebService服务端吗?
问题2: 发送数据到WebService端,要写这段代码吗?
问题3: 假如问题2是我发送的请求 PostSaleCreate,那PostSaleCreate返回的信息是什么意思,我需要做处理吗?
谢谢各位了!!
------解决方案--------------------
LZ你好:
第一个问题:二进制流是可以的,我写过ws上传图片的ws。
第二个问题:我们有了cxf框架没看到LZ贴的那串代码,但是
POST /esPOS_WebService/nv_espos_webservice.asmx HTTP/1.1
Host: 59.41.59.58
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
这一串content-Type一定要有
------解决方案--------------------
当然可以,自己直接通过 HttpWebRequest 就可以发送消息,并通过 Response 解析结果。
但是消息结构必须要按照 SOAP 结构定义。
问题1:可以不调用WebService端的函数,将客户端生成的二进制流数据发送到WebService服务端吗?
问题2: 发送数据到WebService端,要写这段代码吗?
POST /esPOS_WebService/nv_espos_webservice.asmx HTTP/1.1
Host: 59.41.59.58
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<postsalescreate xmlns="http://tempurl.org">
<astr_request>
......
</astr_request>
</postsalescreate>
</soap12:Body>
</soap12:Envelope>
问题3: 假如问题2是我发送的请求 PostSaleCreate,那PostSaleCreate返回的信息是什么意思,我需要做处理吗?
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<postsalescreateResponse xmlns="http://tempurl.org">
<postsalescreateResult> ...... </postsalescreateResult>
</postsalescreateResponse>
</soap12:Body>
</soap12:Envelope>
谢谢各位了!!
------解决方案--------------------
LZ你好:
第一个问题:二进制流是可以的,我写过ws上传图片的ws。
第二个问题:我们有了cxf框架没看到LZ贴的那串代码,但是
POST /esPOS_WebService/nv_espos_webservice.asmx HTTP/1.1
Host: 59.41.59.58
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
这一串content-Type一定要有
------解决方案--------------------
当然可以,自己直接通过 HttpWebRequest 就可以发送消息,并通过 Response 解析结果。
但是消息结构必须要按照 SOAP 结构定义。