基于SOAP的Web Services的开发
来源:互联网 发布:免费sd卡数据恢复软件 编辑:程序博客网 时间:2024/06/07 17:14
打开blog,发现csdn在使用FCKeditor感觉很亲切。因为eHarbors用的也是FCK,前几天刚研究过。现在已经放到服务器上做最后的测试了,bug还是不断的出现。自己写的解析接收eBay SOAPMessage的程序也出现罢工的迹象。以前没有做过基于SOAP的Web Services的开发,对这方面了解不多。经过查资料程序虽然写了出来但是一抛异常就没底了,不知道如何解决。
消息发送测试程序:
/*
* Copyright 2006 eHarbors.com. All Rights Reserved.
*
* This software is the confidential and proprietary information of
* eHarbors.com ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms specified by eHarbors.com
*/
package com.eharbors.notification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
/**
* @author Joe
*
* Important:
*
* Create at 2006-7-21 14:58:35
*/
public class NFTest {
/**
* @param args
* @throws SOAPException
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
// First create the connection
SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory
.newInstance();
SOAPConnection connection = soapConnFactory.createConnection();
// Next, create the actual message
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
// Create objects for the message parts
SOAPPart soapPart = message.getSOAPPart();
StreamSource preppedMsgSrc = new StreamSource(new FileInputStream(
"E:/ebay/endofauc.xml"));
soapPart.setContent(preppedMsgSrc);
message.saveChanges();
URL endpoint = new URL("http://172.18.31.184:8080/eHarbors/receiveNF");
try {
SOAPMessage response = null;
connection.call(message, endpoint);
if (response != null) {
// 输出SOAP消息到控制台
System.out.println("Receive SOAP message from localhost:");
response.writeTo(System.out);
} else {
System.err.println("No response received from partner!");
}
} catch (SOAPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
connection.close();
}
}
}
消息接收者是一个Servlet.有时间再写。
- 基于SOAP的Web Services的开发
- 基于weblogic+axis的web services开发
- WSDL、Web Services、SOAP关键词的理解
- 使用Spring WS 2.0开发基于SOAP的web service
- 如何在ASP环境下利用SOAP来调用C#开发的Web Services
- 如何在ASP环境下利用SOAP来调用C#开发的Web Services
- 如何在ASP环境下利用SOAP来调用C#开发的Web Services
- 使用Myeclipse开发基于xfire的Web Services 入门
- 使用Myeclipse开发基于xfire的Web Services 入门
- Web Services 的理解及SOAP, WSDL, UDDI的关系
- 使用 Web Services Enhancements 发送带有附件的 SOAP 消息
- 弄Tomcat, SOAP的东东,Web Services想说挣点钱不容易
- 使用 Web Services Enhancements 发送带有附件的 SOAP
- 将OFBiz的服务暴露为SOAP Web Services
- 利用 WAS V6.1 开发安全可靠的 Web Services, 第 1 部分:开发基于 JAX-WS 的 Web Services
- 开发简单的Web Services
- 使用eclipse WTP内置的Web Services Explorer测试SOAP based Web Services
- 基于SOAP协议的WEB服务研究
- 针对 Linux 初学者的系统命令简介
- 解决sql server 2000重装时提示文件挂起问题
- 密码人生
- db2的基本操作
- CG_Lession 1
- 基于SOAP的Web Services的开发
- oracle错删表空间的处理办法
- ado.net连接sql server 2000数据库一定要连网(连一个路由也可以)的问题
- Java RPC通信机制之XML-RPC:Apache XML-RPC 3.0开发简介
- 追'小妹'必读!!!
- 使用C#調用外部程式或是執行DOS命令
- Java RPC通信机制之SOAP:应用Apache Axis进行Web Service开发
- SIP协议概述
- 中国古代商人经商十诀